/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.mc.domain.req;

import com.xy.lang.validation.SaveChecks;
import com.xy.lang.validation.UpdateChecks;
import com.xy.lang.validation.annotation.AlertMessage;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 *
 *
 * @author zsp
 * @date 2021-2-25
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class SaveMessageRequest {

	/**
	 * 发送方Id，用户Id或者用户分组Id
	 */
	@NotNull(message = "fromIdRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "fromIdRequired", msg = "发送方id不可为空")
	private Long fromId;
	/**
	 * 发送方类型：0-用户，1-用户分组
	 */
	@NotNull(message = "fromTypeRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "fromTypeRequired", msg = "发送方类型不可为空")
	private Integer fromType;
	/**
	 * 接收方Id，用户Id或者用户分组Id
	 */
	@NotNull(message = "toIdRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "toIdRequired", msg = "接收方id不可为空")
	private Long toId;
	/**
	 * 接收方类型：0-用户，1-用户分组
	 */
	@NotNull(message = "toTypeRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "toTypeRequired", msg = "接收方类型不可为空")
	private Integer toType;
	/**
	 * 是否是离线消息：0-否，1-是
	 */
	@NotNull(message = "offlineFlagRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "offlineFlagRequired", msg = "离线消息状态不可为空")
	private Boolean offlineFlag;
	/**
	 * 失效时间
	 */
	private LocalDateTime expiredTime;
	/**
	 * 数据类型
	 */
	@NotNull(message = "dataTypeRequired", groups = { SaveChecks.class })
	@AlertMessage(code = "dataTypeRequired", msg = "数据类型id不可为空")
	private Integer dataType;

	/**
	 * 状态0 初始 1 发送成功 2 失败 3 已确认
	 */
	@NotNull(message = "messageIdRequired", groups = { UpdateChecks.class })
	@AlertMessage(code = "messageIdRequired", msg = "信息id不可为空")
	private Long messageId;


	/**
	 * 状态0 初始 1 发送成功 2 失败 3 已确认
	 */
	@NotNull(message = "statusRequired", groups = { UpdateChecks.class })
	@AlertMessage(code = "statusRequired", msg = "状态不可为空")
	private Integer status;

}
